<!--
 * @Description: 
 * @Author: ShareKong
 * @Date: 2022-10-29 17:37:35
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-10-30 11:47:11
-->
<template>
    <div>index</div>
    <p>store count: {{store.state.count}}</p>
    <p>
        <el-button @click="store.commit('addCount')">count ++</el-button>
        <el-button @click="getData">get data</el-button>
    </p>
    <pre>
        {{apiRes}}
    </pre>
</template>

<script lang='ts' setup>
import { useStore } from 'vuex'
import { getUserList } from '@/api/test'
import { reactive } from 'vue';

const apiRes = reactive([])

const getData = () => {
    apiRes.length = 0
    getUserList().then(res => {
        console.log(res)
        apiRes.push(...res.data)
    })
}

const store = useStore()

</script>

<style lang='scss' scoped>
    
</style>